package com.example.combwx.mvp.view.people;

import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.blankj.utilcode.util.BarUtils;
import com.example.combwx.R;
import com.example.combwx.mvp.view.people.adapter.PeopleVpAdapter;
import com.flyco.tablayout.SlidingTabLayout;

public class PeopleFragment extends Fragment {
    private View rootView;
    private SlidingTabLayout people_tab;
    private ViewPager people_vp;
    private PeopleVpAdapter adapter;
//    public void getStatusColor(boolean is){
//        if (is==true){
//            BarUtils.setStatusBarColor(getActivity(), Color.RED);
//            getActivity().getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
//        }else {
//            BarUtils.setStatusBarColor(getActivity(), Color.WHITE);
//            getActivity().getWindow().getDecorView().setSystemUiVisibility(
//                    View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
//                            | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
//        }
//    }


    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_people,container,false);
        init();
        return rootView;
    }
    private void init(){
         people_tab = rootView.findViewById(R.id.people_tab);
         people_vp = rootView.findViewById(R.id.people_vp);
         adapter = new PeopleVpAdapter(getFragmentManager());
         people_vp.setAdapter(adapter);
         people_tab.setViewPager(people_vp);
    }
}
